<template>
	<view class="res_box">
		<view class="res_wrap">
			<image src="/static/newImg/closeResult.png" mode="aspectFill" class="cancle" @click="handleguanbi"></image>
			<view class="res_gxkc" :style="{backgroundImage:'url(' + jieguobox.shuju.msg_img + ')'}"></view>
			<view class="res_goods" :style="{backgroundImage:'url(' + jieguobox.shuju.background + ')'}">
				<view class="res_item">
					<view class="image_box">
						<image :src="jieguobox.shuju.prize_icon" mode=""></image>
					</view>
					<view class="text">
						x{{jieguobox.beishu}}
					</view>
					<view class="title">
						{{jieguobox.shuju.prize_name}}
					</view>
					<view class="price">
						参考价：{{jieguobox.shuju.recovery_price}}大王币
					</view>
				</view>
			</view>
			<view class="footer">
				<view style="position: relative;margin-right: 48rpx;" @click="jishou">
					<image src="/static/newImg/again (5).png" mode="aspectFill" ></image>
					<view class="text">
						大王币：<view style="font-size: 10px;">{{(jieguobox.shuju.recovery_price * jieguobox.beishu).toFixed(2)}}</view>
					</view>
				</view>
				<image src="/static/newImg/again.png" mode="aspectFill" @click="guanbi"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props:['jieguobox'],
		data(){
			return{
				
			}
		},
		methods:{
			jishou(){
				uni.showLoading({
				    title: '加载中...'
				})
				let data = {
					order_id :[]
				}
				data.order_id.push(this.jieguobox.shuju.order_id)
				////console.log('ddd',this.jieguobox.shuju.order_id)
				this.$Request.post(this.$api.order.exchange, data).then(res => {
				    uni.hideLoading()
					uni.showToast({
						title: res.msg,
						icon: 'none',
						duration: 1000
					});
					this.$emit('jishou',true)
				});
			},
			handleguanbi(){
				this.$parent.resultShow = false
			},
			guanbi(){
				////console.log('再来一次')
				this.$emit('guanbijg')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.res_box {
		// margin: 0 auto;

		width: 100%;
		height: 700rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;

		.res_wrap {
			width: 100%;
			height: 500rpx;
			margin: 0 auto;
			position: relative;

			.cancle {
				width: 49rpx;
				height: 49rpx;
				position: relative;
				top: 3%;
				right: -88%;
				z-index: 99999;
			}
			.res_gxkc {
				height: 100rpx;
				width: 560rpx;
				background-repeat: no-repeat;
				background-size: 100% 100%;
				position: absolute;
				left: 13%;
			}
			.res_goods {
				width: 760rpx;
				height: 900rpx;
				background-repeat: no-repeat;
				background-size: 100% 100%;
				position: absolute;
				top: 21%;
				left: -1%;
				z-index: 10;

				.res_item {
					.image_box {
						width: 507rpx;
						height: 408rpx;
						background: #FFFFFF;	
						border-radius: 10rpx;
						position: absolute;
						top: 200rpx;
						left: 17%;

						image {
							width: 302rpx;
							height: 241rpx;
							display: block;
							margin: 0 auto;
							margin-top: 58rpx;
						}
					}

					.text {
						width: 137rpx;
						height: 41rpx;
						font-size: 52rpx;
						font-weight: bold;
						font-style: italic;
						color: #FF9C00;
						position: absolute;
						top: 58%;
						left: 67%;
					}

					.title {
						width: 507rpx;
						line-height: 41rpx;
						font-size: 26rpx;
						font-weight: 500;
						color: #FFFFFF;
						position: absolute;
						left: 17%;
						top: 72%;
						overflow: hidden; /*文本超出隐藏*/
						text-overflow: ellipsis; /*文本超出显示省略号*/
						white-space: nowrap; /*超出的空白区域不换行*/
					}

					.price {
						max-width: 507rpx;
						font-size: 28rpx;
						font-weight: bold;
						color: #0CF4FF;
						position: absolute;
						left: 17%;
						top: 79%;
					}
				}


			}

			.footer {
				display: flex;
				justify-content: center;
				// margin-top: 900rpx;
				position: fixed;
				bottom: 30rpx;
				left: 120rpx;
				z-index: 9999;
				.text {
					width: 159rpx;
					height: 29rpx;
					// background: linear-gradient(90deg, #FF8929, #FF6630);
					border-radius: 4px;
					position: absolute;
					left: 17%;
					top: 51%;
					color: #FFFFFF;
					font-size: 12px;
					text-align: center;
					line-height: 29rpx;
					display: flex;
				}

				image {
					width: 224rpx;
					height: 86rpx;
				}
			}

		}
	}
</style>
